; (function (window, undefined) {
    function init(el){
        let js = document.querySelectorAll(el);//获取el标签对象
        for (let i = 0; i < js.length; i++) {//遍历每个标签对象
            this[i] = js[i]
        }
        this.length=js.length;
        
    }

    let jQuery = function (el) {//el是传进来的标签名字，后进行操作
        return new init(el)
    }
    jQuery.extend=function(object){
        for(let key in object){
            init.prototype[key]=obj[key];
        }

    }
    window.jQuery = window.$ = jQuery
})(window)

init.prototype={
    css(atr,val){
        for(let i=0;i<this.length;i++){
            this[i].style[atr]=val;
        }
    }
}

let jqObj =  $("div")
// let jqObj = new $("div")//把标签传进去
console.log(jqObj);
jqObj.css("color","red")